<%@ page import="Model.DAO.CommodityDao" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="Model.Entity.Commodity" %>
<%@ page import="Controlor.Server.CpictureServer" %><%--
  Created by IntelliJ IDEA.
  User: ADMIN
  Date: 2019/1/31
  Time: 19:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<title>主页</title>
<!-- Custom Theme files -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- //Custom Theme files -->
<link href="css/bootstrap.css" type="text/css" rel="stylesheet" media="all">
<link href="css/style.css" type="text/css" rel="stylesheet" media="all">
<!-- js -->
<script src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap-3.1.1.min.js"></script>
<!-- //js -->
<!-- cart -->
<script src="js/simpleCart.min.js"> </script>
<!-- cart -->
</head>
<body>

<!--header-->
<div class="header">
    <div class="container">
        <nav class="navbar navbar-default" role="navigation">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <h1 class="navbar-brand"><a  href="index.html">Yummy</a></h1>
            </div>
            <!--navbar-header-->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <li><a href="index.html" class="active">主页</a></li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">分类<b class="caret"></b></a>
                        <ul class="dropdown-menu multi-column columns-4">
                            <div class="row">
                                <div class="col-sm-3">
                                    <h4>分类</h4>
                                    <ul class="multi-column-dropdown">
                                        <li><a class="list" href="products.jsp?category=0">服装</a></li>
                                        <li><a class="list" href="products.jsp?category=1">电子</a></li>
                                    </ul>
                                </div>
                            </div>
                        </ul>
                    </li>
                    <li class="dropdown grid">
                        <a href="#" class="dropdown-toggle list1" data-toggle="dropdown">Wedding<b class="caret"></b></a>
                        <ul class="dropdown-menu multi-column columns-4">
                            <div class="row">
                                <div class="col-sm-3">
                                    <h4>By Relation</h4>
                                    <ul class="multi-column-dropdown">
                                        <li><a class="list" href="products.jsp">Friend</a></li>
                                        <li><a class="list" href="products.jsp">Lover</a></li>
                                        <li><a class="list" href="products.jsp">Sister</a></li>
                                        <li><a class="list" href="products.jsp">Brother</a></li>
                                        <li><a class="list" href="products.jsp">Kids</a></li>
                                        <li><a class="list" href="products.jsp">Parents</a></li>
                                    </ul>
                                </div>
                                <div class="col-sm-3">
                                    <h4>By Flavour</h4>
                                    <ul class="multi-column-dropdown">
                                        <li><a class="list" href="products.jsp">Chocolate</a></li>
                                        <li><a class="list" href="products.jsp">Mixed Fruit</a></li>
                                        <li><a class="list" href="products.jsp">Butterscotch</a></li>
                                        <li><a class="list" href="products.jsp">Strawberry</a></li>
                                        <li><a class="list" href="products.jsp">Vanilla</a></li>
                                        <li><a class="list" href="products.jsp">Eggless Cakes</a></li>
                                    </ul>
                                </div>
                                <div class="col-sm-3">
                                    <h4>By Theme</h4>
                                    <ul class="multi-column-dropdown">
                                        <li><a class="list" href="products.jsp">Heart shaped</a></li>
                                        <li><a class="list" href="products.jsp">Cartoon Cakes</a></li>
                                        <li><a class="list" href="products.jsp">2-3 Tier Cakes</a></li>
                                        <li><a class="list" href="products.jsp">Square shape</a></li>
                                        <li><a class="list" href="products.jsp">Round shape</a></li>
                                        <li><a class="list" href="products.jsp">Photo cakes</a></li>
                                    </ul>
                                </div>
                                <div class="col-sm-3">
                                    <h4>Weight</h4>
                                    <ul class="multi-column-dropdown">
                                        <li><a class="list" href="products.jsp">1 kG</a></li>
                                        <li><a class="list" href="products.jsp">1.5 kG</a></li>
                                        <li><a class="list" href="products.jsp">2 kG</a></li>
                                        <li><a class="list" href="products.jsp">3 kG</a></li>
                                        <li><a class="list" href="products.jsp">4 kG</a></li>
                                        <li><a class="list" href="products.jsp">Large</a></li>
                                    </ul>
                                </div>
                            </div>
                        </ul>
                    </li>
                    <li class="dropdown grid">
                        <a href="#" class="dropdown-toggle list1" data-toggle="dropdown">Special Offers <b class="caret"></b></a>
                        <ul class="dropdown-menu multi-column columns-4">
                            <div class="row">
                                <div class="col-sm-3">
                                    <h4>By Relation</h4>
                                    <ul class="multi-column-dropdown">
                                        <li><a class="list" href="products.jsp">Friend</a></li>
                                        <li><a class="list" href="products.jsp">Lover</a></li>
                                        <li><a class="list" href="products.jsp">Sister</a></li>
                                        <li><a class="list" href="products.jsp">Brother</a></li>
                                        <li><a class="list" href="products.jsp">Kids</a></li>
                                        <li><a class="list" href="products.jsp">Parents</a></li>
                                    </ul>
                                </div>
                                <div class="col-sm-3">
                                    <h4>By Flavour</h4>
                                    <ul class="multi-column-dropdown">
                                        <li><a class="list" href="products.jsp">Chocolate</a></li>
                                        <li><a class="list" href="products.jsp">Mixed Fruit</a></li>
                                        <li><a class="list" href="products.jsp">Butterscotch</a></li>
                                        <li><a class="list" href="products.jsp">Strawberry</a></li>
                                        <li><a class="list" href="products.jsp">Vanilla</a></li>
                                        <li><a class="list" href="products.jsp">Eggless Cakes</a></li>
                                    </ul>
                                </div>
                                <div class="col-sm-3">
                                    <h4>By Theme</h4>
                                    <ul class="multi-column-dropdown">
                                        <li><a class="list" href="products.jsp">Heart shaped</a></li>
                                        <li><a class="list" href="products.jsp">Cartoon Cakes</a></li>
                                        <li><a class="list" href="products.jsp">2-3 Tier Cakes</a></li>
                                        <li><a class="list" href="products.jsp">Square shape</a></li>
                                        <li><a class="list" href="products.jsp">Round shape</a></li>
                                        <li><a class="list" href="products.jsp">Photo cakes</a></li>
                                    </ul>
                                </div>
                                <div class="col-sm-3">
                                    <h4>Weight</h4>
                                    <ul class="multi-column-dropdown">
                                        <li><a class="list" href="products.jsp">1 kG</a></li>
                                        <li><a class="list" href="products.jsp">1.5 kG</a></li>
                                        <li><a class="list" href="products.jsp">2 kG</a></li>
                                        <li><a class="list" href="products.jsp">3 kG</a></li>
                                        <li><a class="list" href="products.jsp">4 kG</a></li>
                                        <li><a class="list" href="products.jsp">Large</a></li>
                                    </ul>
                                </div>
                            </div>
                        </ul>
                    </li>
                    <li class="dropdown grid">
                        <a href="#" class="dropdown-toggle list1" data-toggle="dropdown">Store<b class="caret"></b></a>
                        <ul class="dropdown-menu multi-column columns-3">
                            <div class="row">
                                <div class="col-sm-4">
                                    <h4>By Relation</h4>
                                    <ul class="multi-column-dropdown">
                                        <li><a class="list" href="products.jsp">Friend</a></li>
                                        <li><a class="list" href="products.jsp">Lover</a></li>
                                        <li><a class="list" href="products.jsp">Sister</a></li>
                                        <li><a class="list" href="products.jsp">Brother</a></li>
                                        <li><a class="list" href="products.jsp">Kids</a></li>
                                        <li><a class="list" href="products.jsp">Parents</a></li>
                                    </ul>
                                </div>
                                <div class="col-sm-4">
                                    <h4>By Flavour</h4>
                                    <ul class="multi-column-dropdown">
                                        <li><a class="list" href="products.jsp">Chocolate</a></li>
                                        <li><a class="list" href="products.jsp">Mixed Fruit</a></li>
                                        <li><a class="list" href="products.jsp">Butterscotch</a></li>
                                        <li><a class="list" href="products.jsp">Strawberry</a></li>
                                        <li><a class="list" href="products.jsp">Vanilla</a></li>
                                        <li><a class="list" href="products.jsp">Eggless Cakes</a></li>
                                    </ul>
                                </div>
                                <div class="col-sm-4">
                                    <h4>Specials</h4>
                                    <ul class="multi-column-dropdown">
                                        <li><a class="list" href="products.jsp">Ice cream cake</a></li>
                                        <li><a class="list" href="products.jsp">Swiss roll</a></li>
                                        <li><a class="list" href="products.jsp">Ruske kape</a></li>
                                        <li><a class="list" href="products.jsp">Cupcakes</a></li>
                                        <li><a class="list" href="products.jsp">Muffin</a></li>
                                        <li><a class="list" href="products.jsp">Merveilleux</a></li>
                                    </ul>
                                </div>
                            </div>
                        </ul>
                    </li>
                </ul>
                <!--/.navbar-collapse-->
            </div>
            <!--//navbar-header-->
        </nav>
        <div class="header-info">
            <div class="header-right search-box">
                <a href="#"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></a>
                <div class="search">
                    <form class="navbar-form">
                        <input type="text" class="form-control">
                        <button type="submit" class="btn btn-default" aria-label="Left Align">
                            Search
                        </button>
                    </form>
                </div>
            </div>

            <%if(session.getAttribute("username")!=null){
            %>
            <div class="header-right login">
                <ul class="nav navbar-nav">
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            个人中心
                            <b class="caret"></b>
                        </a>
                        <ul class="dropdown-menu">
                            <li><a href="center.jsp">进入个人中心</a></li>
                            <li><a href="zhuxiao.jsp">注销</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
            <%}else {%>
            <div class="header-right login">
                <a href="#"><span class="glyphicon glyphicon-user" aria-hidden="true"></span></a>
                <div id="loginBox">
                    <form id="loginForm" method="post" action="UserAction/login">
                        <fieldset id="body">
                            <fieldset>
                                <label for="name">账号</label>
                                <input type="text" name="name" required="required" id="name">
                            </fieldset>
                            <fieldset>
                                <label for="password">密码</label>
                                <input type="password" name="pwd" required="required" id="password">
                            </fieldset>
                            <input type="submit" id="login" value="登录">
                            <label for="checkbox"><input type="checkbox" id="checkbox"> <i>记住我</i></label>
                        </fieldset>
                        <p>新用户 ? <a class="sign" href="register.jsp">注册</a> <span><a href="#">忘记密码?</a></span></p>
                    </form>
                </div>
            </div>
            <%}%>
            <div class="header-right cart">
                <a href="#"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span></a>
                <div class="cart-box">
                    <h4><a href="checkout.html">
                        <span class="simpleCart_total"> $0.00 </span> (<span id="simpleCart_quantity" class="simpleCart_quantity"> 0 </span>)
                    </a></h4>
                    <p><a href="javascript:;" class="simpleCart_empty">Empty cart</a></p>
                    <div class="clearfix"> </div>
                </div>
            </div>
            <div class="clearfix"> </div>
        </div>
        <div class="clearfix"> </div>
    </div>
</div>
<!--//header-->
<!--banner-->
<div class="banner">
    <div class="container">
        <h2 class="hdng">Yummy <span>Cakes</span> for u</h2>
        <p>Our best cakes make your day special</p>
        <a href="products.jsp">SHOP NOW</a>
        <div class="banner-text">
            <img src="images/2.png" alt=""/>
        </div>
    </div>
</div>
<!--//banner-->
<div class="copyrights">Collect from <a href="http://www.cssmoban.com/" >企业网站模板</a></div>
<!--gallery-->
<div class="gallery">
    <div class="container">
        <div class="gallery-grids">
            <div class="col-md-8 gallery-grid glry-one">
                <a href="products.jsp"><img src="images/g1.jpg" class="img-responsive" alt=""/>
                    <div class="gallery-info">
                        <p><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span> view</p>
                        <a class="shop" href="single.html">SHOP NOW</a>
                        <div class="clearfix"> </div>
                    </div>
                </a>
                <div class="galy-info">
                    <p>Lorem Ipsum is simply</p>
                    <div class="galry">
                        <div class="prices">
                            <h5 class="item_price">$95.00</h5>
                        </div>
                        <div class="rating">
                            <span>☆</span>
                            <span>☆</span>
                            <span>☆</span>
                            <span>☆</span>
                            <span>☆</span>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>
            <div class="col-md-4 gallery-grid glry-two">
                <a href="products.jsp"><img src="images/g2.jpg" class="img-responsive" alt=""/>
                    <div class="gallery-info galrr-info-two">
                        <p><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span> view</p>
                        <a class="shop" href="single.html">SHOP NOW</a>
                        <div class="clearfix"> </div>
                    </div>
                </a>
                <div class="galy-info">
                    <p>Lorem Ipsum is simply</p>
                    <div class="galry">
                        <div class="prices">
                            <h5 class="item_price">$95.00</h5>
                        </div>
                        <div class="rating">
                            <span>☆</span>
                            <span>☆</span>
                            <span>☆</span>
                            <span>☆</span>
                            <span>☆</span>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>

            <%
                ArrayList<Commodity> commodities = new CommodityDao().searchCommodityByName("");
                for (Commodity commodity:commodities){%>
            <div class="col-md-3 gallery-grid ">
                <a href="products.jsp"><img src=<%="/CpictureAction/getFirstCpicurlByCommodityId?"+commodity.getId()%>  class="img-responsive" alt=""/>
                    <div class="gallery-info">
                        <p><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span> view</p>
                        <a class="shop" href="single.html">SHOP NOW</a>
                        <div class="clearfix"> </div>
                    </div>
                </a>
                <div class="galy-info">
                    <p><%=commodity.getName()%></p>
                    <div class="galry">
                        <div class="prices">
                            <h5 class="item_price">$<%=commodity.getSellprice()%></h5>
                        </div>
                        <div class="rating">
                            <span>☆</span>
                            <span>☆</span>
                            <span>☆</span>
                            <span>☆</span>
                            <span>☆</span>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>
            <%}%>

        </div>
    </div>
</div>
<!--//gallery-->
<!--subscribe-->
<div class="subscribe">
    <div class="container">
        <h3>Newsletter</h3>
        <form>
            <input type="text" class="text" value="Email" onFocus="this.value = '';" onBlur="if (this.value == '') {this.value = 'Email';}">
            <input type="submit" value="Subscribe">
        </form>
    </div>
</div>
<!--//subscribe-->
<!--footer-->
<div class="footer">
    <div class="container">
        <div class="footer-grids">
            <div class="col-md-2 footer-grid">
                <h4>company</h4>
                <ul>
                    <li><a href="products.jsp">products</a></li>
                    <li><a href="#">Work Here</a></li>
                    <li><a href="#">Team</a></li>
                    <li><a href="#">Happenings</a></li>
                    <li><a href="#">Dealer Locator</a></li>
                </ul>
            </div>
            <div class="col-md-2 footer-grid">
                <h4>service</h4>
                <ul>
                    <li><a href="#">Support</a></li>
                    <li><a href="#">FAQ</a></li>
                    <li><a href="#">Warranty</a></li>
                    <li><a href="contact.html">Contact Us</a></li>
                </ul>
            </div>
            <div class="col-md-3 footer-grid">
                <h4>order & returns</h4>
                <ul>
                    <li><a href="#">Order Status</a></li>
                    <li><a href="#">Shipping Policy</a></li>
                    <li><a href="#">Return Policy</a></li>
                    <li><a href="#">Digital Gift Card</a></li>
                </ul>
            </div>
            <div class="col-md-2 footer-grid">
                <h4>legal</h4>
                <ul>
                    <li><a href="#">Privacy</a></li>
                    <li><a href="#">Terms and Conditions</a></li>
                    <li><a href="#">Social Responsibility</a></li>
                </ul>
            </div>
            <div class="col-md-3 footer-grid icons">
                <h4>Connect with Us</h4>
                <ul>
                    <li><a href="#"><img src="images/i1.png" alt=""/>Follow us on Facebook</a></li>
                    <li><a href="#"><img src="images/i2.png" alt=""/>Follow us on Twitter</a></li>
                    <li><a href="#"><img src="images/i3.png" alt=""/>Follow us on Google-plus</a></li>
                    <li><a href="#"><img src="images/i4.png" alt=""/>Follow us on Pinterest</a></li>
                </ul>
            </div>
        </div>
        <div class="clearfix"></div>
    </div>
</div>
</div>
<!--//footer-->
<div class="footer-bottom">
    <div class="container">
        <p>Copyright &copy; 2015.Company name All rights reserved.More Templates <a href="http://www.cssmoban.com/" target="_blank" title="模板之家">模板之家</a> - Collect from <a href="http://www.cssmoban.com/" title="网页模板" target="_blank">网页模板</a></p>
    </div>
</div>
</body>
</html>
